/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.hk.shop.entity.shop;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.modules.hk.shop.entity.product.HkShopProduct;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 优惠券Entity
 * @author 李欣荣
 * @version 2018-09-27
 */
public class HkShopCoupon extends DataEntity<HkShopCoupon> {
	
	private static final long serialVersionUID = 1L;
	private String title;		// 标题
	private Date beginTime;		// 开始时间
	private String stocks;		// 库存
	private Date endTime;		// 结束时间
	private String state;		// 状态
	private HkShopProduct product;		// 商品id
	private String discount;		// 折扣
	
	public HkShopCoupon() {
		super();
	}

	public HkShopCoupon(String id){
		super(id);
	}

	@Length(min=0, max=100, message="标题长度必须介于 0 和 100 之间")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}
	
	@Length(min=0, max=11, message="库存长度必须介于 0 和 11 之间")
	public String getStocks() {
		return stocks;
	}

	public void setStocks(String stocks) {
		this.stocks = stocks;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	
	@Length(min=0, max=1, message="状态长度必须介于 0 和 1 之间")
	public String getState()	{
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	public HkShopProduct getProduct() {
		return product;
	}

	public void setProduct(HkShopProduct product) {
		this.product = product;
	}
	
	public String getDiscount() {
		return discount;
	}

	public void setDiscount(String discount) {
		this.discount = discount;
	}
	
}